Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RLlib] Fix AlphaStar for tf2+tracing; smaller cleanups around avoiding to wrap a TFPolicy as_eager() or with_tracing more than once. #24271

Merged
merged 7 commits into from
Apr 28, 2022

Conversation

sven1977
Copy link
Contributor

@sven1977 sven1977 commented Apr 27, 2022

Fix AlphaStar for tf2+tracing; smaller cleanups around avoiding to wrap a TFPolicy as_eager() or with_tracing more than once.

Why are these changes needed?

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

if hasattr(orig_cls, "as_eager"):
# Create eager-class (if not already one).
if hasattr(orig_cls, "as_eager") and \
not issubclass(orig_cls, EagerTFPolicy):
cls = orig_cls.as_eager()
if config.get("eager_tracing"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per our offline message, I think the real fix should actually be to pull this

if config.get("eager_tracing"): cls = cls.with_tracing()

block out of as_eager block.
so we will try to enable tracing regardless if we as_eager() here, or somewhere else.
just FYI.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Thanks for the catch.

@sven1977 sven1977 changed the title [RLlib] Add check for avoiding to wrap a TFPolicy as_eager() 2x. [RLlib] Fix AlphaStar for tf2+tracing; smaller cleanups around avoiding to wrap a TFPolicy as_eager() or with_tracing more than once. Apr 28, 2022
@sven1977 sven1977 merged commit 6551922 into ray-project:master Apr 28, 2022
@sven1977 sven1977 deleted the check_not_to_double_wrap_eager branch June 2, 2023 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants